﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Invini.Training.Logging
{
    public class SessionLog
    {
        public string ScriptName
        {
            get;
            set;
        }
        public DateTime StartTime
        {
            get;
            set;
        }

        private List<TriggerLogItem> _triggers = new List<TriggerLogItem>();
        public TriggerLogItem[] Triggers
        {
            get { return this._triggers.ToArray(); }
            set { }
        }

        // It's stupid fact that there has to be parameterless constructor
        // available to serialize this object
        public SessionLog() { }
        public SessionLog(string scriptName,
            DateTime startTime)
        {
            if (scriptName == null)
                throw new ArgumentNullException("scriptName");
            if (startTime == null)
                throw new ArgumentNullException("startTime");

            this.ScriptName = scriptName;
            this.StartTime = startTime;
        }
        public void AddItem(TriggerLogItem item)
        {
            this._triggers.Add(item);
        }
    }
}
